from datetime import datetime
import uvicorn
from fastapi import FastAPI
from database import engine,Base
from router import app  # 导入路由模块


Base.metadata.create_all(bind=engine)

app1 = FastAPI(
    title="题库管理系统API",
    description="提供问题的增删改查功能",
    version="1.0.0"
)

# 注册路由
app1.include_router(app)

@app1.get("/")
async def root():
    return {"message": "题库管理系统API"}

@app1.get("/health")
async def health_check():
    return {"status": "healthy", "timestamp": datetime.now()}

if __name__ == '__main__':
    uvicorn.run('main:app1', host='192.168.110.39', port=8000, reload=True)